package kuzha;

public class SourceLocation {
	public final String fileName;
	public final int beginLine, endLine, beginColumn, endColumn;
	
	public SourceLocation() {
		this(null, 0, 0, 0, 0);
	}
	public SourceLocation(String fileName) {
		this(fileName, 0, 0, 0, 0);
	}
	public SourceLocation(String fileName, int beginLine) {
		this(fileName, beginLine, -1, beginLine, -1);
	}
	public SourceLocation(String fileName, int beginLine, int beginColumn) {
		this(fileName, beginLine, beginColumn, beginLine, beginColumn);
	}
	public SourceLocation(String fileName, int beginLine, int beginColumn, int endLine, int endColumn) {
		this.fileName = fileName;
		this.beginLine = beginLine;
		this.beginColumn = beginColumn;
		this.endLine = endLine;
		this.endColumn = endColumn;
	}
	@Override
	public String toString() {
		return String.format("%s: %d,%d - %d,%d", fileName, beginLine, beginColumn, endLine, endColumn);
	}
}
